package TestDemo;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: Administrator
 * Date: 2024-03-13
 * Time: 15:23
 */

class Dog{
    public String name;
    public int age;
    public String color;
    public void eat(){
        System.out.println(name + "正在吃狗粮！");
    }
    public void wag(){
        System.out.println(name  + "正在汪汪叫！");
    }
}

class Cat{
    public String name;
    public int age;
    public String color;

    public void eat(){
        System.out.println(name + "正在吃猫条！");
    }
    public void wag(){
        System.out.println(name  + "正在喵喵叫！");
    }
}

public class Test {
    public static void main(String[] args) {
        Dog dog = new Dog();
        dog.name = "初一";
        dog.age = 3;
        dog.color = "黑色";
        dog.eat();
        dog.wag();

        System.out.println("===================");

        Cat cat = new Cat();
        cat.name = "初五";
        cat.age = 2;
        cat.color = "白色";
        cat.eat();
        cat.wag();
    }
}
